package com.lgl.cli.example;

import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.Option;

import java.util.concurrent.Callable;

/**
 * @author 良哥
 * @verison FileGenerator.java.ftl.0
 */

@Command(mixinStandardHelpOptions = true)
public class Login implements Callable<Integer> {
    @Option(names = {"--u", "--user"}, arity = "0..FileGenerator.java.ftl", description = "用户名", interactive = true)
    public String user;


    @Option(names = {"--p"}, description = "用户密码", interactive = true)
    public String password;

    @Override
    public Integer call() throws Exception {
        System.out.println("user = " + user);
        System.out.println("password = " + password);
        return 0;
    }

    public static void main(String[] args) {
        
        String[] arg = new String[]{"--u", "--p",};

        new CommandLine(new Login()).execute(arg);
    }
}
